package com.lzy.webapi.controller;

import com.lzy.framework.core.output.Result;
import com.lzy.webapi.component.Auth;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Description:
 * Author: yuanjf
 * Version: 1.0
 * Create Date Time: 2017/3/29 下午3:44.
 * Update Date Time:
 *
 * @see 'http://lzyhll.com'
 */
@Controller
@RequestMapping("/api/logout")
public class LogoutController extends BaseController {

    private static final  Logger logger = Logger.getLogger(LogoutController.class);

    /**
     * 登出/注销
     */
    @Auth
    @RequestMapping(method = RequestMethod.GET)
    @ResponseBody
    public Result logout(@RequestHeader("token") String token) {
        this.deleteToken(token);
        return new Result(true);
    }

}

